//
//  SinaBaseViewController.m
//  MySinaWeiboProjectForOC
//
//  Created by apple on 2016/11/13.
//  Copyright © 2016年 WangChen. All rights reserved.
//

#import "SinaBaseViewController.h"
#import "SinaOAuthViewController.h"
#import "SinaUserAccountViewModel.h"


@interface SinaBaseViewController ()<buttonDidClickProtocol>
//判断是否登录了
@property (nonatomic,assign) BOOL isLogin;



@end

@implementation SinaBaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    
}



#pragma mark
#pragma mark - 重写loadView方法
-(void)loadView{
    if([SinaUserAccountViewModel shared].isLogin){
        
        UITableView *tableView = [[UITableView alloc]init];
        self.view = tableView;
        self.tableView = tableView;
        return;
        
    }
    
    SinaVisitorView *visitorView = [[SinaVisitorView alloc]init];
    self.view = visitorView;
    visitorView.delegate = self;
    _visitorView = visitorView;
    
    
    
    
}


#pragma mark
#pragma mark - 点击按钮代理方法
-(void)loginBtnDidClick{
    
    NSLog(@"点击了登录按钮");
    SinaOAuthViewController *OAuthVC = [[SinaOAuthViewController alloc]init];
    UINavigationController *naviVC = [[UINavigationController alloc]initWithRootViewController:OAuthVC];
    [self presentViewController:naviVC animated:YES completion:nil];
    
}
-(void)registBtnDidClick{
    
    NSLog(@"点击了注册按钮");
    
}






@end
